#!/bin/sh

BASE_PATH="."
BINARY="${BASE_PATH}/tremded.x86"

# Server's file configuration
CONFIG_FILE="server.cfg"

# 1: local server, not visible on the masterserver
# 2: internet server, visible on server list
DEDICATED=1

# 0: use dynamic library game file (.so/.dynlib/.dll file)
# 1: use game.qvm (interpreted mode)
# 2: use game.qvm (compiling mode)
VM_GAME=2

# UDP port used
# PORT=30720

# Display game's color in terminal
ANSICOLOR=1

# Ready to rumble!

if [ "$PORT" != "" ];
then
  exec $BINARY +set dedicated $DEDICATED +set fs_basepath $BASE_PATH +set vm_game $VM_GAME +set net_port $PORT +set com_ansiColor $ANSICOLOR +exec $CONFIG_FILE $*
else
  exec $BINARY +set dedicated $DEDICATED +set fs_basepath $BASE_PATH +set vm_game $VM_GAME +set com_ansiColor $ANSICOLOR +exec $CONFIG_FILE $*
fi

exit $?

